package com.nancy.java_design.mediator.demo1;

public class Client {
    public static void main(String[] args) {
        // 创建中介者对象
        MediatorStructure mediator = new MediatorStructure();

        // 创建同事对象
        Tenant tenant = new Tenant("房客 Alice", mediator);
        HomeOwner homeOwner = new HomeOwner("房主 王先生", mediator);
        // 设置中介者对象
        mediator.setHomeOwner(homeOwner);
        mediator.setTenant(tenant);

        tenant.send("Hello, I want to rent a house");
        homeOwner.send("你会说中文吗？我这里有一套两居室，你看下吧");
    }
}
